<%@ page import="com.example.bean.Student" %>
<%@ page import="com.example.util.DBUtil" %>
<%@ page import="java.sql.Connection" %>
<%@ page import="java.sql.PreparedStatement" %>
<%@ page import="java.sql.ResultSet" %>
<%@ page import="java.sql.SQLException" %><%--
  Created by IntelliJ IDEA.
  User: ASUS
  Date: 2021/11/23
  Time: 13:17
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>学员信息显示</title>
</head>
<body>
<h1>学员信息显示</h1>

<%
    try {
        Connection connection = DBUtil.getConnection();
        String sql = "select * from s_user";
        PreparedStatement preparedStatement = connection.prepareStatement(sql);
        ResultSet resultSet = preparedStatement.executeQuery();
        while (resultSet.next()) {
            String sname = resultSet.getString("sname");

            String ssex = resultSet.getString("ssex");

            String sage = resultSet.getString("sage");

            String semail = resultSet.getString("semail");

            String stext = resultSet.getString("stext");

            out.println("姓名:" + sname);
            out.println("<br>");
            out.println("性别:" + ssex);
            out.println("<br>");
            out.println("出生日期:" + sage);
            out.println("<br>");
            out.println("邮箱:" + semail);
            out.println("<br>");
            out.println("备注:" + stext);
            out.println("<br>");
            out.println("-------------------------------------------------");
            out.println("<br>");
            out.println("-------------------------------------------------");
            out.println("<br>");
        }
    }catch(SQLException e){
        e.printStackTrace();
    }
%>

</body>
</html>
